using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Rensselaer_Event_Finder
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void loginBtn_Click(object sender, EventArgs e)
        {
           Globals.CurrentUser = Globals.getUserService().login(usernameBox.Text, passwordBox.Text);
           if (Globals.CurrentUser != null)
           {
               this.DialogResult = DialogResult.OK;
               this.Close();
           }
           else
           {
               MessageBox.Show("Incorrect Login Info", "Error");
           }
        }

        private void cancelBtn_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

    }
}